home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
language
/
examples.zoo
/
misc
/
parallel.lsp
< prev
next >
Wrap
Lisp/Scheme
|
1991-10-22
|
1KB
|
33 lines
; Verarbeitung pseudoparalleler Prozesse, Michael Stoll, Nov. 1987
(setq parallelfuns '(parallelfuns scheduler function_1 function_2))
(defun scheduler (&rest list-of-functions)
(let ((alist (mapcar #'list list-of-functions)))
(do ((lof list-of-functions (if (rest lof) (rest lof) list-of-functions)))
(nil)
(let* ((fun (first lof))
(ass (assoc fun alist :test #'eq))
(vars (rest ass)))
(setf (rest ass) (if vars (funcall fun t vars) (funcall fun nil nil)))
) ) ) )
(defun function_1 (flag vars)
(do ((count1 10 (1- count1))
(count2 (if flag (first vars) (char-code #\A))
(if (= count2 (char-code #\Z)) (char-code #\A) (1+ count2))))
((zerop count1) (list count2))
(write-char (code-char count2))
) )
(defun function_2 (flag vars)
(do ((count1 7 (1- count1))
(count2 (if flag (first vars) (char-code #\0))
(if (= count2 (char-code #\9)) (char-code #\0) (1+ count2))))
((zerop count1) (list count2))
(write-char (code-char count2))
) )
; (scheduler #'function_1 #'function_2) aufrufen.